﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;

namespace eeenno.ReaderEngine.Objects
{
    [Serializable]

    /// <summary>
    /// Representation of a Google Reader article
    /// </summary>
    public class Article : IComparable<Article>
    {
        private long _long_date = 0;
        private string _id = String.Empty;
        private string _date = String.Empty;
        private string _url = String.Empty;
        private string _tag = String.Empty;
        private string _title = String.Empty;
        private string _author = String.Empty;
        private string _summary = String.Empty;
        private bool _unread;
        private bool _starred;
        private string _site_name = String.Empty;
        private string _site_url = String.Empty;

        private int _index = 0;

        public int CompareTo(Article item)
        {
            return long_date.CompareTo(item.long_date);
        }

        public Article()
        {
        }

        public Article(string id, string date, string url, string tag,
            string title, string author, string summary, string site_name, string site_url,
            bool unread, bool starred)
        {
            _id = id;
            _date = date;
            _url = url;
            _tag = tag;
            _title = title;
            _author = author;
            _summary = summary;
            _unread = unread;
            _site_name = site_name;
            _site_url = site_url;
            _starred = starred;
        }

        public string site_url
        {
            get { return _site_url; }
            set { _site_url = value; }
        }

        public string site_name
        {
            get { return _site_name; }
            set { _site_name = value; }
        }

        public string id
        {
            get { return _id; }
            set { _id = value; }
        }

        public long long_date
        {
            set { _long_date = value; }
            get { return _long_date; }
        }

        public string date
        {
            get { return _date; }
            set { _date = value; }
        }

        public string url
        {
            get { return _url; }
            set { _url = value; }
        }

        public string tag
        {
            get { return _tag; }
            set { _tag = value; }
        }

        public string title
        {
            get { return _title; }
            set { _title = value; }
        }

        public string author
        {
            get { return _author; }
            set { _author = value; }
        }

        public string summary
        {
            get { return _summary; }
            set { _summary = value; }
        }

        public bool unread
        {
            get { return _unread; }
            set { _unread = value; }
        }

        public bool starred
        {
            get { return _starred; }
            set { _starred = value; }
        }

        public int index
        {
            get { return _index; }
            set { _index = value; }
        }
    }
}
